<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>墨滴目录插件</title>
    <style>
      body {
        width: 320px;
        padding: 20px;
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          sans-serif;
        margin: 0;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
      }

      .header {
        text-align: center;
        margin-bottom: 20px;
      }

      .header h1 {
        margin: 0;
        font-size: 18px;
        font-weight: 600;
      }

      .header p {
        margin: 5px 0 0 0;
        font-size: 12px;
        opacity: 0.8;
      }

      .content {
        background: rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        padding: 15px;
        margin-bottom: 15px;
      }

      .feature-list {
        list-style: none;
        padding: 0;
        margin: 0;
      }

      .feature-list li {
        padding: 8px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        font-size: 14px;
      }

      .feature-list li:last-child {
        border-bottom: none;
      }

      .feature-list li::before {
        content: "✓";
        color: #4ade80;
        font-weight: bold;
        margin-right: 8px;
      }

      .config-section {
        background: rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        padding: 15px;
        margin-bottom: 15px;
      }

      .config-title {
        font-size: 14px;
        font-weight: 600;
        margin-bottom: 12px;
        display: flex;
        align-items: center;
      }

      .config-title::before {
        content: "⚙️";
        margin-right: 8px;
      }

      .config-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 10px;
        padding: 8px 0;
      }

      .config-item:last-child {
        margin-bottom: 0;
      }

      .config-label {
        font-size: 13px;
        flex: 1;
      }

      .toggle-switch {
        position: relative;
        display: inline-block;
        width: 40px;
        height: 20px;
      }

      .toggle-switch input {
        opacity: 0;
        width: 0;
        height: 0;
      }

      .slider {
        position: absolute;
        cursor: pointer;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(255, 255, 255, 0.3);
        transition: 0.3s;
        border-radius: 20px;
      }

      .slider:before {
        position: absolute;
        content: "";
        height: 16px;
        width: 16px;
        left: 2px;
        bottom: 2px;
        background-color: white;
        transition: 0.3s;
        border-radius: 50%;
      }

      input:checked + .slider {
        background-color: #4ade80;
      }

      input:checked + .slider:before {
        transform: translateX(20px);
      }

      .status {
        text-align: center;
        padding: 10px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 6px;
        font-size: 12px;
      }

      .footer {
        text-align: center;
        font-size: 11px;
        opacity: 0.7;
        margin-top: 15px;
      }

      .save-btn {
        background: #4ade80;
        color: white;
        border: none;
        padding: 8px 16px;
        border-radius: 6px;
        font-size: 12px;
        cursor: pointer;
        transition: background-color 0.2s;
        margin-top: 10px;
        width: 100%;
      }

      .save-btn:hover {
        background: #22c55e;
      }

      .save-btn:disabled {
        background: rgba(255, 255, 255, 0.3);
        cursor: not-allowed;
      }
    </style>
  </head>
  <body>
    <div class="header">
      <h1>📚 墨滴目录插件</h1>
      <p>为墨滴编辑器添加智能目录功能</p>
    </div>

    <div class="content">
      <ul class="feature-list">
        <li>自动生成文章目录</li>
        <li>支持多级标题缩进</li>
        <li>平滑滚动跳转</li>
        <li>实时更新目录内容</li>
        <li>美观的界面设计</li>
      </ul>
    </div>

    <div class="config-section">
      <div class="config-title">配置选项</div>
      <div class="config-item">
        <label class="config-label">默认显示目录菜单</label>
        <label class="toggle-switch">
          <input type="checkbox" id="defaultShowMenu" />
          <span class="slider"></span>
        </label>
      </div>
    </div>

    <button class="save-btn" id="saveConfig">保存配置</button>

    <div class="status">✅ 插件已激活，请在墨滴编辑器中使用</div>

    <div class="footer">版本 1.0.1 | 优化版本</div>

    <script src="popup.js"></script>
  </body>
</html>
